// require('dotenv').config();
const mysql = require('mysql2/promise');    // 使用promise风格的API

// 创建连接池
const pool = mysql.createPool({
    host: process.env.MYSQL_HOST,
    user: process.env.MYSQL_USER,
    password: process.env.MYSQL_PASSWORD,
    database: process.env.MYSQL_DATABASE,
    waitForConnections: true,
    connectionLimit: 10, // 最大连接数
    queueLimit: 0 // 无限制等待队列
});
module.exports = pool;